<template>
  <div class="child">
    <h2>我父亲给我的：</h2>
    <ul>
      <li>房子：{{ house }}</li>
      <li>车子：{{ car }}</li>
      <li>票子：{{ money }}</li>
    </ul>
    <hr>
    <h2>我自己的：</h2>
    <ul>
      <li>玩具：{{ toy }}</li>
    </ul>
    <button @click="sendToy(toy)">把玩具给父亲</button>
  </div>
</template>

<script>
  export default {
    name:'Child',
    props:['house','money','car','sendToy'],
    data() {
      return {
        toy:'奥特曼'
      }
    },
    /* methods: {
      handleClick(){
        this.sendToy(this.toy)
      }
    }, */
  }
</script>

<style scoped>
  .child {
    margin-top: 10px;
    margin-bottom: 10px;
    background-color: skyblue;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 0 10px;
  }
  li {
    font-size: 18px;
  }
</style>